#if NEW_STRINGS
char* extra = (char*) xmalloc(25 + wpt->gc_data->placer.length() + wpt->shortname.length());
#else
- char* extra = (char*) xmalloc(25 + strlen(wpt->gc_data->placer.toUtf8().data()) + strlen(wpt->shortname));
+ char* extra = (char*) xmalloc(25 + strlen(CSTR(wpt->gc_data->placer)) + strlen(wpt->shortname));
#endif
sprintf(extra, "\r\nBy %s\r\n%s (%1.1f/%1.1f)",
- wpt->gc_data->placer.toUtf8().data(),
+ CSTR(wpt->gc_data->placer),
CSTRc(wpt->shortname), wpt->gc_data->diff/10.0,
wpt->gc_data->terr/10.0);
rec->name = xstrappend(rec->name, extra);
UrlLink l = wpt->GetUrlLink();
int len = 7 + l.url_.length();
char* extra = (char*)xmalloc(len);
- sprintf(extra, "{URL=%s}", l.url_.toUtf8().data());
+ sprintf(extra, "{URL=%s}", CSTR(l.url_));
rec->name = xstrappend(rec->name, extra);
xfree(extra);
if(rec->url) {
if ((wpt->icon_descr != NULL) || (wpt->wpt_flags.proximity) || \
(option_icon != NULL)) {
gbfprintf(fout, "w %s,0,0.0,16777215,255,1,7,,%.1f\n",
- wpt->icon_descr.isNull() ? "Waypoint" : wpt->icon_descr.toUtf8().data(),
+ wpt->icon_descr.isNull() ? "Waypoint" : CSTR(wpt->icon_descr),
WAYPT_GET(wpt, proximity, 0));
}
}
/* macros */
#define LAT_DIR(a) a < 0.0 ? 'S' : 'N'
#define LON_DIR(a) a < 0.0 ? 'W' : 'E'
-#define NONULL(a) a.isNull() ? "" : a.toLatin1().data()
+#define NONULL(a) a.isNull() ? "" : CSTRc(a)
#define ISWHITESPACE(a) ((a == ' ') || (a == '\t'))
/* convert excel time (days since 1900) to time_t and back again */
if (wpt->HasUrlLink()) {
UrlLink l = wpt->GetUrlLink();
buff = QString().sprintf(fmp->printfc,
- !l.url_link_text_.isEmpty() ? l.url_link_text_.toUtf8().data() : fmp->val);
+ !l.url_link_text_.isEmpty() ? CSTR(l.url_link_text_) : fmp->val);
}
break;
case XT_ICON_DESCR:
buff = QString().sprintf(fmp->printfc,
(!wpt->icon_descr.isNull()) ?
- wpt->icon_descr.toUtf8().data() : fmp->val);
+ CSTR(wpt->icon_descr) : fmp->val);
break;
/* LATITUDE CONVERSION***********************************************/
field_is_unknown = wpt->gc_data->type == gt_unknown;
break;
case XT_GEOCACHE_HINT:
- buff = QString().sprintf(fmp->printfc, wpt->gc_data->hint.toUtf8().data());
+ buff = QString().sprintf(fmp->printfc, CSTR(wpt->gc_data->hint));
field_is_unknown = !wpt->gc_data->hint.isEmpty();
break;
case XT_GEOCACHE_PLACER:
- buff = QString().sprintf(fmp->printfc, wpt->gc_data->placer.toUtf8().data());
+ buff = QString().sprintf(fmp->printfc, CSTR(wpt->gc_data->placer));
field_is_unknown = !wpt->gc_data->placer.isEmpty();
break;
case XT_GEOCACHE_ISAVAILABLE:
if (symbol < 0) {
symbol = 0;
if (!wp->icon_descr.isNull()) {
- symbol = waypoint_symbol_index(wp->icon_descr.toUtf8().data());
+ symbol = waypoint_symbol_index(CSTR(wp->icon_descr));
}
}
p->symbol = symbol;
static void
print_string(const char* fmt, const QString& string)
{
- print_string(fmt, string.toUtf8().data());
+ print_string(fmt, CSTR(string));
}
static void
gdb_write_cstr_list(const QString& str)
{
- return gdb_write_cstr_list(str.toLatin1().data());
+ return gdb_write_cstr_list(CSTRc(str));
}
static void
cnt += wpt->url_link_list_.size();
FWRITE_i32(cnt);
foreach(UrlLink l, wpt->GetUrlLinks()) {
- FWRITE_CSTR(l.url_.toUtf8().data());
+ FWRITE_CSTR(l.url_);
}
}
(wpt->altitude < 0.0)) ? 0 : wpt->altitude,
'm',
CSTRc(wpt->description) ? tdesc : "",
- icon_token.toUtf8().data());
+ CSTR(icon_token));
xfree(tdesc);
}
fwrite_integer(fd, 0);
} else {
fwrite_integer(fd, str.length());
- gbfwrite(str.toLatin1().data(), 1, str.length(), fd);
+ gbfwrite(CSTRc(str), 1, str.length(), fd);
}
}
gbfputc(0x03, ofd); // inline string follows
gbfputcstr(data, ofd);
} else {
- char* tmp_ent = xml_entitize(data.toUtf8().data());
+ char* tmp_ent = xml_entitize(CSTR(data));
gbfputs(tmp_ent, ofd);
xfree(tmp_ent);
}
0 : waypointp->altitude);
append(obuf, CSTRc(waypointp->shortname));
append(obuf, CSTR(cname));
- append(obuf, placer.toUtf8().data());
- append(obuf, waypointp->gc_data->hint.toUtf8().data());
+ append(obuf, CSTR(placer));
+ append(obuf, CSTR(waypointp->gc_data->hint));
append(obuf, ctype);
append(obuf, placeddate.toUtf8());
append(obuf, lfounddate.toUtf8());
wpt_len,
CSTRc(owpt),
CSTRc(odesc),
- icon_token.toUtf8().data());
+ CSTR(icon_token));
mag_writemsg(obuf);
if (!is_file) {
vcf_print(s);
xfree(s);
} else {
- vcf_print(wpt->gc_data->hint.toUtf8().data());
+ vcf_print(CSTR(wpt->gc_data->hint));
}
gbfprintf(file_out, "\nEND:VCARD\n");
{
xg_tag_mapping* tm;
for (tm = xg_tag_tbl; tm->tag_cb != NULL; tm++) {
- if (str_match(tag.toUtf8().data(), tm->tag_name) && (cb_type == tm->cb_type)) {
+ if (str_match(CSTR(tag), tm->tag_name) && (cb_type == tm->cb_type)) {
return tm->tag_cb;
}
}
gbfprintf(fout, "%*s<shape type=\"waypoint\"", space++*2, "");
xol_write_string("name", name);
xol_write_string("comment", wpt->notes);
- xol_write_string("icon", wpt->icon_descr.toUtf8().data());
+ xol_write_string("icon", wpt->icon_descr);
if (wpt->creation_time.isValid()) {
xol_write_time(wpt);
}